package com.lihaozhe.orderservice.dto;

import java.time.LocalDateTime;
import java.util.List;

/**
 * 订单数据传输对象
 *
 * @author 李昊哲
 * @version 1.0.0
 */
public class OrderDTO {
  /**
   * 订单ID
   */
  private Long id;
  /**
   * 用户ID
   */
  private Long userId;
  /**
   * 订单项列表
   */
  private List<OrderItemDTO> items;
  /**
   * 订单总金额
   */
  private Double totalAmount;
  /**
   * 订单状态
   */
  private String status;
  /**
   * 创建时间
   */
  private LocalDateTime createTime;

  // 构造函数
  public OrderDTO() {
  }

  public OrderDTO(Long userId, List<OrderItemDTO> items, Double totalAmount, String status) {
    this.userId = userId;
    this.items = items;
    this.totalAmount = totalAmount;
    this.status = status;
    this.createTime = LocalDateTime.now();
  }

  public OrderDTO(Long id, Long userId, List<OrderItemDTO> items, Double totalAmount, String status) {
    this.id = id;
    this.userId = userId;
    this.items = items;
    this.totalAmount = totalAmount;
    this.status = status;
    this.createTime = LocalDateTime.now();
  }

  // Getter和Setter方法
  public Long getId() {
    return id;
  }

  public void setId(Long id) {
    this.id = id;
  }

  public Long getUserId() {
    return userId;
  }

  public void setUserId(Long userId) {
    this.userId = userId;
  }

  public List<OrderItemDTO> getItems() {
    return items;
  }

  public void setItems(List<OrderItemDTO> items) {
    this.items = items;
  }

  public Double getTotalAmount() {
    return totalAmount;
  }

  public void setTotalAmount(Double totalAmount) {
    this.totalAmount = totalAmount;
  }

  public String getStatus() {
    return status;
  }

  public void setStatus(String status) {
    this.status = status;
  }

  public LocalDateTime getCreateTime() {
    return createTime;
  }

  public void setCreateTime(LocalDateTime createTime) {
    this.createTime = createTime;
  }
}
